﻿@model _1_31_2015_SLMSite.Models.UserViewModel
@{
    ViewBag.Title = "AddUpdateUser";
}

<h2>AddUpdateUser</h2>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-4">
            <h2>Update/Create User</h2>
            @using (Html.BeginForm())
            {

                <div class="form-group">
                    @Html.LabelFor(u => u.FirstName)
                    @Html.TextBoxFor(u => u.FirstName, new { @class = "form-control" })
                </div>


                <div class="form-group">
                    @Html.LabelFor(u => u.LastName)
                    @Html.TextBoxFor(u => u.LastName, new { @class = "form-control" })
                </div>

                <div class="form-group">
                    @Html.LabelFor(u => u.DisplayName)
                    @Html.TextBoxFor(u => u.DisplayName, new { @class = "form-control" })
                </div>

                <div class="form-group">
                    @Html.LabelFor(u => u.Email)
                    @Html.TextBoxFor(u => u.Email, new { @class = "form-control" })
                </div>

                <div class="form-group">
                    @Html.LabelFor(u => u.ImgUrl)
                    @Html.TextBoxFor(u => u.ImgUrl, new { @class = "form-control" })
                </div>
                
                if (@Model.UserId != null)
                {
                    <div class="form-group">
                        @Html.DropDownListFor(u => u.Role, new SelectList(Model.Roles, null, null), Model.Role, new { @class = "form-control" })
                    </div>
                }
                else
                {
                    <div class="form-group">
                        @Html.DropDownListFor(u => u.Role, new SelectList(Model.Roles, null, null), "--Select Role--", new { @class = "form-control" })
                    </div>
                }

                <input type="hidden" value="@Model.UserId" name="userName" />
                <input type="submit" class="btn btn-info" value="Upate/Create User" />
            }

        </div>

    </div>
</div>
